const str = "hello <form asdfawef><haha ></haha>"

console.log(str.replace(/\</g,"\\<"))